﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo03
{
    //{分析：任务 NPC，商贩 NPC，铁匠 NPC，三种 NPC 的种类。
    //共有属性：npc 的名字，npc 的类型；
    //共有方法：都能和玩家交互(交谈)；

    abstract class NPC
    {

        private string npcname;
        private string workinfo;
        public string NpcName { get { return npcname; } set { this.npcname = value; } }
        public string Workinfo { get { return this.workinfo; } set { this.workinfo = value; } }
        public abstract void Speak();
        public NPC() { }
        public NPC(string name, string workinfo)
        {
            this.NpcName = name;
            this.Workinfo = workinfo;

        }

    }
    class Tesk : NPC
    {


        public override void Speak()
        {
            Console.WriteLine("我是{0},我有件重要的是需要你帮我去做:{1}", this.NpcName, this.Workinfo);
        }
    }
    class Shop : NPC
    {
        public Shop() { }
        public Shop(string name, string workinfo) : base(name, workinfo)
        {
        }

        public override void Speak()
        {
            Console.WriteLine("我是{0},我这有:{1}，客官要不要买？", this.NpcName, this.Workinfo);
        }
    }
    class Ironsmith : NPC
    {

        public Ironsmith() { }
        public Ironsmith(string name, string workinfo) : base(name, workinfo)
        {
        }
        public override void Speak()
        {
            Console.WriteLine("我是{0},{1}吗？", this.NpcName, this.Workinfo);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {   //送信npc
            Tesk tesk1 = new Tesk();
            tesk1.NpcName = "信使";
            tesk1.Workinfo = "我有封信需要你帮忙送给某某";
            tesk1.Speak();
            //杀怪npc
            Tesk tesk2 = new Tesk();
            tesk2.NpcName = "阿芬";
            tesk2.Workinfo = "去杀了某某";
            tesk2.Speak();
            //采集npc
            Tesk tesk3 = new Tesk();
            tesk3.NpcName = "潘潘";
            tesk3.Workinfo = "帮我带回某物？";
            tesk3.Speak();
            //武器npc
            Shop shop1 = new Shop("11", "22");
            shop1.Speak();
            //材料npc
            Shop shop2 = new Shop("33", "44");
            shop2.Speak();
            //食物npc
            Shop shop3 = new Shop("55", "66");
            //修补npc
            Ironsmith ironsmith1 = new Ironsmith("77", "88");
            ironsmith1.Speak();
            //强化npc
            Ironsmith i2 = new Ironsmith("77", "99");
            i2.Speak();
            //打造npc
            Ironsmith i3 = new Ironsmith("77", "00");
            i3.Speak();
        }
    }
}
